/* eslint-disable import/prefer-default-export */
import { readonly } from 'vue'
import { createParam, createParamAction } from '@/store/globalParam'
import { createFence, createFenceAction } from '@/store/fence'
import { createPillar, createPillarAction } from '@/store/pillar'
import { createDoor, createDoorAction } from '@/store/door'
import { createDrawing, createDrawingAction } from '@/store/drawing'

const globalParam = createParam()
const globalParamAction = createParamAction(globalParam)
const fence = createFence()
const fenceAction = createFenceAction(fence)
const pillar = createPillar()
const pillarAction = createPillarAction(pillar)
const door = createDoor()
const doorAction = createDoorAction(door)
const drawing = createDrawing()
const drawingAction = createDrawingAction(drawing)

export const useStore = () => {
  const store = {
    globalParam: readonly(globalParam),
    globalParamAction: readonly(globalParamAction),
    fence: readonly(fence),
    fenceAction: readonly(fenceAction),
    pillar: readonly(pillar),
    pillarAction: readonly(pillarAction),
    door: readonly(door),
    doorAction: readonly(doorAction),
    drawing: readonly(drawing),
    drawingAction: readonly(drawingAction)
  }

  return store
}
